//
//  FTRulerSlider.h
//  FashionTech
//
//  Created by JackieYip on 16/5/15.
//  Copyright © 2016年 mondial-d. All rights reserved.
//

#import <UIKit/UIKit.h>

@class FTRuler;
@class FTTextField;

typedef NS_ENUM(NSInteger, FTRulerUnitType)
{
    FTRulerUnitType_single,
    FTRulerUnitType_cmAndInch,
    FTRulerUnitType_kgAndLb
};

typedef NS_ENUM(NSUInteger, FTRulerUnitStatus)
{
    FTRulerUnitStatus_metricSystem,
    FTRulerUnitStatus_englishSystem
};

@protocol FTRulerDelegate <NSObject>
- (void)FTRulerSlider:(FTRuler *)slider saveFirstResponder:(UIResponder *)firstResponder;
- (void)discardFirstResponderInFTRulerSlider:(FTRuler *)slider;
- (void)FTRulerSlider:(FTRuler *)slider ValueChange:(int )value;
- (void)FTRulerSlider:(FTRuler *)slider didChangeRulerUnit:(NSString *)unit;

@end

@interface FTRuler : UIView
@property (strong, nonatomic, readonly) FTTextField *valueTF;
@property (nonatomic, weak) id<FTRulerDelegate> delegate;
/**
 *
 *
 *  @param realValue realValue 现实的数值
 *  @param animated
 */
-(void)setRealValue:(double)realValue animated:(BOOL)animated;

- (instancetype)initWithFrame:(CGRect)frame
                        title:(NSString *)title
                  currentUnit:(NSString *)currentUnit
                 currentValue:(double)currentValue             // 初始值
                     minValue:(int)minValue
                     maxValue:(int)maxValue
                   unitStatus:(FTRulerUnitStatus)unitStatus        // 选中的单位下标
                     unitType:(FTRulerUnitType)unitType     // 单位类型
                   needHeadBG:(BOOL)needHeadBG;              // 是否需要上部背景
@end
